package cn.wsalix.weixin.req.entity;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.thoughtworks.xstream.annotations.XStreamAlias;

import cn.wsalix.weixin.message.req.ReqType;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "WX_REQ_MES_LOCATION")
@Inheritance(strategy = InheritanceType.JOINED)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
public final class LocationReqMsg extends BaseReqMsg {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1871149099841706238L;
	@XStreamAlias("Location_X")
	private double locationX;
	@XStreamAlias("Location_Y")
    private double locationY;
	@XStreamAlias("Scale")
    private int    scale;
	@XStreamAlias("Label")
    private String label;

    public LocationReqMsg(double locationX, double locationY, int scale,
                          String label) {
        super();
        this.locationX = locationX;
        this.locationY = locationY;
        this.scale = scale;
        this.label = label;
        setMsgType(ReqType.LOCATION);
    }

    public double getLocationX() {
        return locationX;
    }

    public double getLocationY() {
        return locationY;
    }

    public int getScale() {
        return scale;
    }

    public String getLabel() {
        return label;
    }

}
